package spring.angularjs.customannotation;

import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

@Documented
@Constraint(validatedBy = {Phone2Validator.class})
@Target({ ElementType.METHOD, ElementType.FIELD })
@Retention(RUNTIME)
public @interface Phone2 {

	String message() default "Invalid. Phone have 10 or 11 number. Valid formats 01234567890 or 0996320065";
	
	Class<?>[] groups() default { };

	Class<? extends Payload>[] payload() default { };
}
